package game.systems.light.lightBeam
{
	import ash.core.Component;
	
	public class LightBeam extends Component
	{
		public var invalidate:Boolean = false;
		
		private var _color:uint;
		private var _thickness:Number;
		
		private var _maxLength:int = 1000;
		private var _length:Number;
		
		public function LightBeam(color:uint = 0xFFFFFF, thickness:Number = 20, maxLength:int = 1000)
		{
			this.color 		= color;
			this.thickness 	= thickness;
			this.maxLength 	= maxLength;
			this.length		= maxLength;
		}
		
		public function get color():uint { return this._color; }
		public function set color(color:uint):void
		{
			this._color = color;
			this.invalidate = true;
		}
		
		public function get length():Number { return this._length; }
		public function set length(length:Number):void
		{
			if(length > this._maxLength)
				length = this._maxLength;
			
			this._length = length;
			this.invalidate = true; 
		}
		
		public function get maxLength():int { return this._maxLength; }
		public function set maxLength(maxLength:int):void
		{
			this._maxLength = maxLength;
			this.invalidate = true; 
		}
		
		public function get thickness():Number { return this._thickness; }
		public function set thickness(thickness:Number):void
		{
			this._thickness = thickness;
			this.invalidate = true; 
		}
	}
}